package com.study.ssm.aop.spring;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author zhoujunlin
 * @date 2023年07月24日 11:15
 * @desc
 */
public class Around implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("Around.invoke========>before");
        Object ret = null;
        try {
            ret = methodInvocation.proceed();
        } catch (Exception e) {
            System.out.println("Around.invoke========>exception");
            e.printStackTrace();
        }
        System.out.println("Around.invoke========>after");

        return ret;
    }

}
